package ui;

import org.uqbar.arena.actions.MessageSend;
import org.uqbar.arena.layout.HorizontalLayout;
import org.uqbar.arena.widgets.Button;
import org.uqbar.arena.widgets.Label;
import org.uqbar.arena.widgets.Panel;
import org.uqbar.arena.windows.SimpleWindow;
import org.uqbar.arena.windows.WindowOwner;

import applicationModels.AlmanaqueZombies;
import applicationModels.DialogReiniciar;

public class DialogWindowRestart extends SimpleWindow<DialogReiniciar> {
   

public DialogWindowRestart(WindowOwner parent) {
	super(parent, new DialogReiniciar());
		// TODO Auto-generated constructor stub
	}

private static final long serialVersionUID = 1L;
	

	
	@Override
	protected void addActions(Panel actionsPanel) {
		
		
		
		
		
		
	}
	
	@Override
	protected void createFormPanel(Panel mainPanel) {
		
		this.setTitle("Reiniciar Juego");
		
		//mainPanel.setLayout(new HorizontalLayout());
		
		new Label(mainPanel).setText("¿Realmente quiere reiniciar el juego?");
		
		Panel principal = new Panel(mainPanel).setLayout(new HorizontalLayout());
		
		new Button(principal).onClick(new MessageSend(this, "reiniciar")).setCaption("Reiniciar");
		
		new Button(principal)
		.setCaption("Cancelar")
		.onClick(new MessageSend(this, "close"));
		
		
		
	}
	
	
	public void reiniciar() {
		this.getModelObject().getReiniciar();
		this.close();
	}
}
